home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / International System⁄HyperCard / KanjiTalk Toolkit / Sample Code / KeyScript / KeyScript.h next >
Encoding:
C/C++ Source or Header  |  2002-01-01  |  5.7 KB  |  152 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware TextEdit Sample Application
  6. #
  7. #    KeyScript
  8. #
  9. #    KeyScript.h    -    Rez and C Include Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. ------------------------------------------------------------------------------*/
  15.  
  16. #define kPrefSize                122
  17. #define kMinSize                38
  18.     
  19. /* The following constants are used to identify menus and their items. The menu IDs
  20.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  21. #define    mApple                    128        /* Apple menu */
  22. #define    iAbout                    1
  23.  
  24. #define    mFile                    129        /* File menu */
  25. #define    iNew                    1
  26. #define    iClose                    4
  27. #define    iQuit                    12
  28.  
  29. #define    mEdit                    130        /* Edit menu */
  30. #define    iUndo                    1
  31. #define    iCut                    3
  32. #define    iCopy                    4
  33. #define    iPaste                    5
  34. #define    iClear                    6
  35.  
  36. /*    1.01 - kTopLeft - This is for positioning the Disk Initialization dialogs. */
  37.  
  38. #define kDITop                    0x0050
  39. #define kDILeft                    0x0070
  40.  
  41. /* 1.01 - changed constants to begin with 'k' for consistency, except for resource IDs */
  42. /*    kTextMargin is the number of pixels we leave blank at the edge of the window. */
  43. #define kTextMargin                2
  44.  
  45. /* kMaxOpenDocuments is used to determine whether a new document can be opened
  46.    or created. We keep track of the number of open documents, and disable the
  47.    menu items that create a new document when the maximum is reached. If the
  48.    number of documents falls below the maximum, the items are enabled again. */
  49. #define    kMaxOpenDocuments        1
  50.     
  51. /*    kMaxDocWidth is an arbitrary number used to specify the width of the TERec's
  52.     destination rectangle so that word wrap and horizontal scrolling can be
  53.     demonstrated. */
  54. #define    kMaxDocWidth            576
  55.     
  56. /* kMinDocDim is used to limit the minimum dimension of a window when GrowWindow
  57.     is called. */
  58. #define    kMinDocDim                64
  59.  
  60. /*    kControlInvisible is used to 'turn off' controls (i.e., cause the control not
  61.     to be redrawn as a result of some Control Manager call such as SetCtlValue)
  62.     by being put into the contrlVis field of the record. kControlVisible is used
  63.     the same way to 'turn on' the control. */
  64. #define kControlInvisible        0
  65. #define kControlVisible            0xFF
  66.  
  67. /*    kScrollbarAdjust and kScrollbarWidth are used in calculating
  68.     values for control positioning and sizing. */
  69. #define kScrollbarWidth            16
  70. #define kScrollbarAdjust        (kScrollbarWidth - 1)
  71.  
  72. /*    kScrollTweek compensates for off-by-one requirements of the scrollbars
  73.  to have borders coincide with the growbox. */
  74. #define kScrollTweek            2
  75.     
  76. /*    kCrChar is used to match with a carriage return when calculating the
  77.     number of lines in the TextEdit record. kDelChar is used to check for
  78.     delete in keyDowns. */
  79. #define kCrChar                    13
  80. #define kDelChar                8
  81.     
  82. /*    kButtonScroll is how many pixels to scroll horizontally when the button part
  83.     of the horizontal scrollbar is pressed. */
  84. #define kButtonScroll            4
  85.     
  86. /*    kMaxTELength is an arbitrary number used to limit the length of text in the TERec
  87.     so that various errors won't occur from too many characters in the text. */
  88. #define    kMaxTELength            32000
  89.  
  90. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  91.    SysEnvRec we understand. */
  92. #define    kSysEnvironsVersion        1
  93.  
  94. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  95.    by MultiFinder. Once we determine that an event is an OSEvent, we look at the
  96.    high byte of the message sent to determine which kind it is. To differentiate
  97.    suspend and resume events we check the resumeMask bit. */
  98. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  99. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  100. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  101. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  102. #define    kNoEvents                0        /* no events mask */
  103.  
  104. /* 1.01 - kMinHeap - This is the minimum result from the following
  105.      equation:
  106.             
  107.             ORD(GetApplLimit) - ORD(ApplicZone)
  108.             
  109.      for the application to run. It will insure that enough memory will
  110.      be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  111.      application, and still give the application some 'breathing room'.
  112.      To derive this number, we ran under a MultiFinder partition that was
  113.      our requested minimum size, as given in the 'SIZE' resource. */
  114.      
  115. #define    kMinHeap                 (29 * 1024)
  116.     
  117. /* 1.01 - kMinSpace - This is the minimum result from PurgeSpace, when called
  118.      at initialization time, for the application to run. This number acts
  119.      as a double-check to insure that there really is enough memory for the
  120.      application to run, including what has been taken up already by
  121.      pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  122.      
  123. #define    kMinSpace                (20 * 1024)
  124.  
  125. /*    kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  126. #define kExtremeNeg                -32768
  127. #define kExtremePos                (32767 - 1)    /* required to address an old region bug */
  128.     
  129. /* kTESlop provides some extra security when pre-flighting edit commands. */
  130. #define    kTESlop                    1024
  131.  
  132. /* The following are indicies into STR# resources. */
  133. #define    eWrongMachine            1
  134. #define    eSmallSize                2
  135. #define    eNoMemory                3
  136. #define    eNoSpaceCut                4
  137. #define    eNoCut                    5
  138. #define    eNoCopy                    6
  139. #define    eExceedPaste            7
  140. #define    eNoSpacePaste            8
  141. #define    eNoWindow                9
  142. #define    eExceedChar                10
  143. #define    eNoPaste                11
  144.  
  145. #define    rMenuBar    128                /* application's menu bar */
  146. #define    rAboutAlert    128                /* about alert */
  147. #define    rUserAlert    129                /* user error alert */
  148. #define    rDocWindow    128                /* application's window */
  149. #define    rVScroll    128                /* vertical scrollbar control */
  150. #define    rHScroll    129                /* horizontal scrollbar control */
  151. #define    kErrStrings    128                /* error string list */
  152.